package com.micro.service.dubbo.controller;

import com.micro.service.api.ContextFacade;
import com.micro.service.common.po.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import static com.micro.service.dubbo.constance.Router.PRE_FIX;

@RestController
@RequestMapping(PRE_FIX)
@Api(tags = "dubbo消费端测试Api")
public class ContextController {
    @Autowired
    private ContextFacade contextFacade;

    @ApiOperation(value = "查询固定字符串信息")
    @GetMapping("/getFixInfo")
    @ApiImplicitParam(name = "name", value = "姓名", paramType = "query")
    public CommonResult<List<String>> getFixInfo(@RequestParam(required = false) String name) {
        return contextFacade.getFixInfo(name);
    }

}
